package muproject;

public class encoding {

	public static void main(String arg[]) {
	char caChOne[] = new char[1];
	caChOne[0] = '\u4E00';
	String sChOne = new String(caChOne);
	System.out.println(sChOne);
	try
	{
	    byte baChOneBig5[] = new byte[2];
	    baChOneBig5[0] = (byte)0xA4;
	    baChOneBig5[1] = (byte)0x40;
	    System.out.println(new String(baChOneBig5, "BIG5"));
	    baChOneBig5 = sChOne.getBytes("BIG5");
	    System.out.print("BIG5:");
	    for(int i = 0; i < baChOneBig5.length; ++i)
	     System.out.print(String.format("%02X", baChOneBig5[i]));
	    System.out.println();
	    byte baChOneUTF8[] = sChOne.getBytes("UTF8");
	    System.out.print("UTF8:");
	    for(int i = 0; i < baChOneUTF8.length; ++i)
	     System.out.print(String.format("%02X", baChOneUTF8[i]));
	    System.out.println();
	    byte baChOneUTF16[] = sChOne.getBytes("UTF16");
	    System.out.print("UTF16:");
	    for(int i = 0; i < baChOneUTF16.length; ++i)
	     System.out.print(String.format("%02X", baChOneUTF16[i]));
	    System.out.println();
	}
	catch(java.io.UnsupportedEncodingException e)
	{
		
	}
	}
}
